<?php 

if (!empty($_POST)) die;

$page = @intval($_GET['page']);
$kind_filter = @intval($_COOKIE['lmcy_index_kind_filter']);

$cond = '';

switch ($kind_filter) {
case 2:
	$cond = "WHERE kind = 'TZ'";
	break;
case 3:
	$cond = "WHERE kind = 'DB'";
	break;
}

if (empty($page)) { $page = 1; }
$limit = 20;

$lmcys = dt_query("SELECT id FROM finance_lmcy $cond ORDER BY c_at LIMIT ".$limit * ($page - 1).",$limit");
if (!$lmcys) {
	put_info('获取数据失败！');
	header('Location:?c=finance');
	die;
}

?>
<?php require_once('finance/inc/nav_sub_aqbz.html') ?>
<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<div class="finance-filter-well">
				<ul id="kind_filter" class="nav nav-pills">
					<li class="disabled"> <a href="#">成员类型</a> </li>
					<li class=""><a href="javascript:do_kind_filter(1)">全部</a></li>
					<li class=""><a href="javascript:do_kind_filter(2)">投资公司</a></li>                       
					<li class=""><a href="javascript:do_kind_filter(3)">担保公司</a></li>                       
				</ul>
			</div>
		</div>
	</div>
</div>
<div class="container">
	<div class="row clearfix">
		<?php while($lmcy = mysql_fetch_array($lmcys)) { ?>
		<div class="col-md-3 column">
			<div class="finance-panel">
				<center>
					<a href="<?php echo s_url('?c=finance&a=item_list_cond&lmcy_id='.$lmcy['id']) ?>"><img height="71px" src="img/finance/lmcy/logo/<?php echo $lmcy['id'] ?>"/></a>
				</center>
			</div>
		</div>
		<?php } ?>
	</div>
	<?php pagination('finance_lmcy', $cond, $page, $limit, '?c=finance&a=lmcy_index&page=') ?>
</div>
<script type="text/javascript">
$(document).ready(function(){
	$('li#finance_aqbz').addClass('active');
	$('li#aqbz_lmcy').addClass('active');
	var kind_filter = ('' == getCookie('lmcy_index_kind_filter')) ? 1 : getCookie('lmcy_index_kind_filter');
	$('ul#kind_filter').find('li:eq('+kind_filter+')').addClass('active');
});

function do_kind_filter(mark) {
	setCookie('lmcy_index_kind_filter', mark, 365, '/');
	location = '<?php echo s_url('?c=finance&a=lmcy_index') ?>';
}
</script>

